<? include_once("class/Usuario.class.php"); ?>
<?php 
session_start();
$unUsuario = $_SESSION["admin"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TemplateBeginEditable name="doctitle" -->
  <title>MagicInvoices</title>
  <!-- TemplateEndEditable -->
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="description" content="PuertoPago" />
  <meta name="author" content="ARothar" />
  <meta name="robots" content="nofollow" />   
  
  <script src="js/jquery-1.4.2.js" type="text/javascript"></script> 
  <script src="js/jquery.validate.js" type="text/javascript" ></script>
  <script type='text/javascript' src='js/loadmask/jquery.loadmask.min.js'></script>
	<script type="text/javascript">
        /* Hide messages and tooltip configuration */
        $(function() {
                // Hide divs
                // Enter the class 'hidethis' in a div and you can hide it
                // when you click it, used here for the message divs
                $("div.hidethis").click(function(){$(this).slideUp("fast");});
        
                // Tooltip Configuration
                // Enter one of the following classes (eg 'tooltip-top') to an element and to the
                // title attribute of it add the text you want to appear in the tooltip.
                // You can set the fade to true for a fade in/out effect
                $('.tooltip-top').tipsy({fade: false, gravity: 's'});
                $('.tooltip-right').tipsy({fade: false, gravity: 'w'});
                $('.tooltip-bottom').tipsy({fade: false, gravity: 'n'});
                $('.tooltip-left').tipsy({fade: false, gravity: 'e'});
        });
		$(document).ready(function(){
			$("#container").ajaxStart(function(){
				$("#container").mask("Procesando...");
			});
			$("#container").ajaxStop(function(){
				$("#container").unmask();
			});
		});
		
    </script>
   
  <!-- Favicon & styles -->
  <link rel="shortcut icon" href="img/favicon.ico" />
  <link type="text/css" rel="stylesheet" href="css/style.css" />
  <link rel='stylesheet' type='text/css' href='js/loadmask/jquery.loadmask.css' />
  <!-- Skins (uncomment the style you want to change the skin) -->
    <!-- <link type="text/css" rel="stylesheet" href="css/skins/green.css" /> -->
    <!-- <link type="text/css" rel="stylesheet" href="css/skins/darkred.css" /> -->
    <!-- <link type="text/css" rel="stylesheet" href="css/skins/purple.css" /> -->
  <!-- END OF Skins -->
  
  <!-- Markitup styles -->
  <link type="text/css" rel="stylesheet" href="js/markitup/skins/markitup/style.css" />
  <link type="text/css" rel="stylesheet" href="js/markitup/sets/default/style.css" />
  
	<!--[if IE 6]>
		<link type="text/css" rel="stylesheet" href="css/ie6.css" />
	<![endif]-->
  <!--[if IE]>
  <style type="text/css">
    .clearfix {
      zoom: 1;     /* triggers hasLayout */
      display: block;     /* resets display for IE/Win */
      }  /* Only IE can see inside the conditional comment
      and read this CSS rule. Don't ever use a normal HTML
      comment inside the CC or it will close prematurely. */
  </style>
  <![endif]-->
  <!-- END OF Favicon & styles -->
  <!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>

<body>
	
  <!-- Push a little! -->
  <div class="push"></div>
 
  <!-- Container, holds the page -->
  <div id="container">
  
  	<!-- Header -->
    <div id="header">
      <div id="logo"><a href="index.php" class="logo"><img src="../img/logo-web-facturas.png" /></a></div>
    <? if ($_SESSION["admin"]) { ?>
      <div id="admin-details">
        <img src="img/avatar.png" alt="avatar" />
        Bienvenido <strong><?=$unUsuario->alias ?></strong>! <a href="inc/admin.logout.php" class="a-red">Logout?</a><br />
      </div>
          <? } ?>
    </div>

    <!-- END OF Header -->
    
    <!-- A div with clearfix to hold the floated divs inside -->
  	<div class="clearfix">
    
    	<!-- Content -->
      <div id="content">
      	<!-- Main navigation OLD
        <div id="nav" class="clearfix">
          <ul id="nav-menu">
            <li><a href="#" class="active">Dashboard</a></li>
            <li><a href="#">Posts</a></li>
            <li><a href="#">Users</a></li>
            <li><a href="#">Comments</a></li>
            <li><a href="#">Newsletter</a></li>
            <li><a href="#">Settings</a></li>
          </ul>
        </div>
        END OF Main Navigation OLD -->

        <!-- Main navigation NEW -->
        <div id="nav">
          <ul id="jsddm" class="clearfix">
          	<? if ($unUsuario->esAdmin == 1) { ?>
            <li><a href="facturasListar.php" class="">Facturas</a></li>
            
            <li><a href="usuarioListar.php" class="">Usuario</a></li>
            <? } ?>
          </ul>
        </div>
        <!-- TemplateBeginEditable name="cuerpo" -->

		<!-- TemplateEndEditable -->
      </div>
      <!-- END OF CONTENT -->
    </div>
  	<!-- END OF Div with clearfix -->
    
    <!-- Footer -->
    <div id="footer">2011 &copy; <strong>MagicInvoices</strong> by Alejandro Rothar</div>
    
  </div>
  <!-- END OF Container -->
  
  <!-- Push a little -->
  <div class="push"></div>
  
  
  <!-- Javascript -->
  
  	<!-- Jquery -->
    <!-- You can include the jquery form googleapis.com to save bandwidth -->
    <!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> -->
    <!-- Simple dropdown menu -->
    <script src="js/dropdown.js" type="text/javascript"></script>

    <!-- Tooltip (jquery plugin) -->
    <script src="js/jquery.tipsy.js" type="text/javascript"></script>
    
    <!-- Markitup (jquery plugin) -->
    <script src="js/markitup/jquery.markitup.pack.js" type="text/javascript"></script>
    <script src="js/markitup/sets/default/set.js" type="text/javascript"></script>
    <script src="js/jquery.markitup.config.js" type="text/javascript"></script> <!-- You can configure further the plugin in this file -->
    
    <!-- CUSTOM CODE (Character limit, sidebar functions, Twitter ajax functionality, hide messages, tooltip) -->
    <script type="text/javascript">
        /* Character limit (jquery plugin) */
        (function($){$.fn.extend({limit:function(limit,element){var interval,f;var self=$(this);$(this).focus(function(){interval=window.setInterval(substring,100)});$(this).blur(function(){clearInterval(interval);substring()});substringFunction="function substring(){ var val = $(self).val();var length = val.length;if(length > limit){$(self).val($(self).val().substring(0,limit));}";if(typeof element!='undefined')substringFunction+="if($(element).html() != limit-length){$(element).html((limit-length<=0)?'0':limit-length);}";substringFunction+="}";eval(substringFunction);substring()}})})(jQuery);
        /* END OF Character limit (jquery plugin) */

        /* Hide messages and tooltip configuration */
        $(function() {
                // Hide divs
                // Enter the class 'hidethis' in a div and you can hide it
                // when you click it, used here for the message divs
                $("div.hidethis").click(function(){$(this).slideUp("fast");});

                // Tooltip Configuration
                // Enter one of the following classes (eg 'tooltip-top') to an element and to the
                // title attribute of it add the text you want to appear in the tooltip.
                // You can set the fade to true for a fade in/out effect
                $('.tooltip-top').tipsy({fade: false, gravity: 's'});
                $('.tooltip-right').tipsy({fade: false, gravity: 'w'});
                $('.tooltip-bottom').tipsy({fade: false, gravity: 'n'});
                $('.tooltip-left').tipsy({fade: false, gravity: 'e'});
        });
        /* END OF Hide messages and tooltip configuration */

       </script>
    <!-- END OF CUSTOM CODE -->
  <!-- END OF Javascript -->
  
</body>

</html>
